<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier-html-xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<link rel="stylesheet" href="${aier_css_url}social/classes/common.css" />
<link rel="stylesheet" href="${aier_css_url}social/classes/cmanage.css" />


<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
</head>
<!-- 班级信息页面 -->
<body> 
	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user"
		executeResult="true"></s:action>

	<!-- 正文 -->
	<div id="hfContent" class="ar-content">
		<div class="content-main">
			<!-- 班级名称栏 -->
			<s:action name="ccomm_classesMTitle" namespace="/classes" executeResult="true"></s:action>
			<div class="main-content wrap-bg clearfix">
				<!-- 左侧栏 -->
				<s:action name="ccomm_classesMLeft" namespace="/classes" executeResult="true"></s:action>
				<!-- 右侧内容 -->
				<div class="ae-right">
					<div class="right-main">
						<div class="right-main-top">
							<div class="binfo-title">
								<span>基本资料</span>
							</div>
							<div class="right-line">
							</div>
						</div>
						<div class="right-main-c">
							<div class="info-tab01 ci-table" style="margin-top: 30px;">
								<table>
									<tr style="height:35px;">
										<th class="gray6">班级名称：</th>
										<td><input maxlength="20" type="text" class="PY-input" id="cname" value="${classes.cname}">
										</td>
									</tr>
									<tr>
										<th class="gray6 s-profile">班级信息：</th>
										<td>
											<textarea id="desinfo" class="ci-txtarea">${classes.desinfo}</textarea>
											<p id="textCount">
											</p>
										</td>
									</tr>
									<tr>
										<th class="gray6 s-profile">班级宣言：</th>
										<td><textarea class="s-txtarea" id="manifesto" >${classes.manifesto}</textarea>
											<p id="teCount">
											</p>
										</td>
									</tr>
									<tr>
										<th></th>
										<td>
											<div class="mib-btn" onclick="ciUpdate()">
											</div>
										</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>

			</div>

		</div>
		<!-- footer copyright -->
		<s:action name="userhomecomm_homeFooter" namespace="/user" executeResult="true"></s:action>
		<!-- /footer copyright -->
	</div>
	<div id="hfFooter" class="ar-footer"></div>
</body>
<script type="text/javascript">
//班级信息字数限制
$("#desinfo").live("input", function() {
		var curLength = $("#desinfo").val().length;

		if (curLength > 100) {
			//var num = $("#desinfo").val().substr(0, 100);
			//$("#desinfo").val(num);
			var le = $("#desinfo").val().length-100;
			$("#textCount").html("<span style='color:#E44443;font-size: 12px;'>已超出"+le+"个字</span>");//剩余字数
		} else {
			var le = 100 - $("#desinfo").val().length;
			$("#textCount").html("<span style='font-size: 12px;'>还可以输入"+le+"个字</span>");//剩余字数
		}
	});
	
//班级宣言字数限制
$("#manifesto").live("input", function() {
	var curLength = $("#manifesto").val().length;

	if (curLength > 500) {
		//var num = $("#desinfo").val().substr(0, 100);
		//$("#desinfo").val(num);
		var le = $("#manifesto").val().length-500;
		$("#teCount").html("<span style='color:#E44443;font-size: 12px;'>已超出"+le+"个字</span>");//剩余字数
	} else {
		var le = 500 - $("#manifesto").val().length;
		$("#teCount").html("<span style='font-size: 12px;'>还可以输入"+le+"个字</span>");//剩余字数
	}
});




var cid = "${classes.cid}";
//保存班级信息
function ciUpdate() {
	var fun = function(data) {
		if (data.s == 1) {
			$().message("修改成功!");
		} else {
			$().message(data.error_info);
		}
	};
	exeAjax(
		ajaxUrl("${aier_url}${aier_urijs}cbinfo_updateClassInfo${aier_suffix}"),
		fun, {
			"cid" : cid,
			"cname" : $("#cname").val(),
			"desinfo" : $("#desinfo").val(),
			"manifesto" : $("#manifesto").val()
		});

}
</script>
</html>